#include "Message.h"
#include "Subscriber.h"
#include "MessageSystem.h"

MessageSystem* MessageSystem::s_singleton = new MessageSystem();

MessageSystem::MessageSystem()
{
	;
}

MessageSystem* MessageSystem::GetInstance()
{
	return s_singleton;
}

void MessageSystem::add_subscriber( Subscriber* sub )
{
	if(sub)
	{
		m_subscribers_cs.lock();
		m_subscribers.push_back(sub);
		m_subscribers_cs.unlock();
	}
}